import { request } from "@/utils/http";

import type { ReqGetHospitalListParams, ReqGetHospitalListResponse ,ProvinceList,HospitalItemType} from "./model/hospitalListTypes";


// 获取医院列表

export const reqGetHospitalList = ({ page, limit, ...restParams }: ReqGetHospitalListParams) => {
    return request.get<any, ReqGetHospitalListResponse>(`/admin/hosp/hospital/${page}/${limit}`, { params: restParams });
}

// 获取省份数据
export const reqGetProvinceList = (dictCode = "province") => {
    return request.get<any, ProvinceList>(`/admin/cmn/dict/findByDictCode/${dictCode}`)
}


// 获取市区数据
export const reqGetCityOrDistrictList = (parentId: number) => {
    return request.get<any,ProvinceList>(`/admin/cmn/dict/findByParentId/${parentId}`)
  }


//   获取医院详情
export const reqGetHospitalShow = (id: string) => {
    return request.get<any, HospitalItemType>(`/admin/hosp/hospital/show/${id}`);
}